package net.towee.client.event.core;

import net.towee.model.repo.DocumentData;

import com.google.gwt.event.shared.GwtEvent;

public class DocumentReceivedEvent extends GwtEvent<DocumentReceivedHandler> {
	public static Type<DocumentReceivedHandler> TYPE = new Type<DocumentReceivedHandler>();
	private final DocumentData result;
	private final boolean local;
	
	public DocumentReceivedEvent(DocumentData result, boolean local) {
		this.local = local;
		this.result = result;
	}

	@Override
	public com.google.gwt.event.shared.GwtEvent.Type<DocumentReceivedHandler> getAssociatedType() {
		return TYPE;
	}

	@Override
	protected void dispatch(DocumentReceivedHandler handler) {
		handler.onDocumentReceived(result, local);
	}

}
